package jmine.tec.aop;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum AOPMessages implements MessageCreator {
    RESULT_INVALID_ANNOTATED_METHOD(0, "jmine.tec.aop.result.invalidAnnotatedMethod"),

    RESULT_INVALID_KEY_FIELD(0, "jmine.tec.aop.result.invalidKeyField"),

    RESULT_INVALID_RESULT_CLASS(0, "jmine.tec.aop.result.invalidResultClass"),

    RESULT_INVALID_RESULT_FIELD(0, "jmine.tec.aop.result.invalidResultField"),

    RESULT_INVALID_NO_ARG_METHOD(0, "jmine.tec.aop.result.invalidNoArgMethod"),

    RESULT_EMPTY_KEYS(0, "jmine.tec.aop.result.emptyKeys"),

    RESULT_INDEX_OUT_OF_BOUNDS(2, "jmine.tec.aop.result.indexOutOfBounds");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private AOPMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-aop-utils-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
